// Copyright Leonid Shlyapnikov 2010
// Distributed under the GNU Lesser General Public License http://www.gnu.org/licenses/lgpl.html
//    author: Leonid Shlyapnikov, created on: Jul 13, 2010

#include <boost/test/test_tools.hpp>
#include "../../main/fixparser/ChecksumConverter.h"


void ChecksumConverter_test() {
    using fixparser::ChecksumConverter;

    const ChecksumConverter& converter = ChecksumConverter::instance();

    BOOST_CHECK_EQUAL("000", converter.checksumToString(0));
    BOOST_CHECK_EQUAL("001", converter.checksumToString(1));
    BOOST_CHECK_EQUAL("005", converter.checksumToString(5));
    BOOST_CHECK_EQUAL("009", converter.checksumToString(9));
    BOOST_CHECK_EQUAL("010", converter.checksumToString(10));
    BOOST_CHECK_EQUAL("011", converter.checksumToString(11));
    BOOST_CHECK_EQUAL("077", converter.checksumToString(77));
    BOOST_CHECK_EQUAL("099", converter.checksumToString(99));
    BOOST_CHECK_EQUAL("100", converter.checksumToString(100));
    BOOST_CHECK_EQUAL("101", converter.checksumToString(101));
    BOOST_CHECK_EQUAL("128", converter.checksumToString(128));
    BOOST_CHECK_EQUAL("255", converter.checksumToString(255));
}
